package cn.linlane.controller.sys;

import cn.linlane.controller.BaseController;
import cn.linlane.entity.sys.SysDepart;
import cn.linlane.service.sys.SysAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cheng
 * @date 2018-07-19 9:50
 */
@Api(value = "权限接口说明", description = "权限接口说明")
@RestController
@RequestMapping(value = "/sys/auth")
public class SysAuthController extends BaseController {

    @Autowired
    private SysAuthService sysAuthService;



    @ApiOperation(value = "查询当前用户权限", httpMethod = "GET", response = SysDepart.class)
    @GetMapping("/authtree")
    public Object authtree() {
        return setSuccessMyMap(sysAuthService.getCurrentAuth());
    }

    @ApiOperation(value = "查询所有权限", httpMethod = "GET", response = SysDepart.class)
    @GetMapping("/authtreeall")
    public Object authtreeall() {
        return setSuccessMyMap(sysAuthService.getAllAuth());
    }

}
